www.gusucode.com > 落叶冰点万能企业网站内容管理系统 V9.1 > 落叶冰点万能企业网站内容管理系统 V9.1\code\admin\adminHTML\test6.asp

    <%
bianma_reg="\<meta.+\s{0,}charset\s{0,}=\s{0,}([^\""|\s|\>|\/]*)\s{0,}[\""']?\s{0,}.+\/{0,1}\>"

title_reg="\<title\>(.*)\<\/title\>"




Function GetCode(str,regstr)
Dim Reg,serStr
set Reg= new RegExp
Reg.IgnoreCase = True
Reg.MultiLine = True
Reg.Pattern =regstr
if Reg.test(str) then '若查询到匹配项
   Set Cols = Reg.Execute(str)
   serStr=trim(Cols(0).SubMatches(0)) '使用匹配到的第一个匹配项
else '否则给个默认值gb2312,有点省懒法,如果页面没给出编码格式,想知道确实有点麻烦
   serStr=encodeingxxx_in_http_header
end if
GetCode=serStr
end function

'response.write GetCode("<meta http-equiv=""Content-Type"" content=""text/html; charset= gb2312 "" />",bianma_reg)





'****************************************8

Function is_tong_root_www(wwwv)

is_tong_root_www=0
s_wwwa="http://www.chinesent.com.cn"


'1.a.com,1.a.com.cn,aa.1.a.com.cn,1.a.cc,.org,.info,.net,.net.cn,.org.cn,.tv
'www.a.com,www.a.com.cn,www.aa.a.com.cn
if lcase(left(wwwv,7))="http://" then
wwwv=mid(wwwv,8,len(wwwv)-8+1)
end if
s_wwwa=mid(s_wwwa,8,len(s_wwwa)-8+1)

sss_w_1=split(s_wwwa,".")
sss_w_2=split(wwwv,".")

is_yiyang_root=0
yiyang_com=0
firstrun=1
ss_i2=ubound(sss_w_2)
for ss_i=ubound(sss_w_1) to 0 step -1

sss_w_1_1=trim(lcase(sss_w_1(ss_i)))

sss_w_1_2=trim(lcase(sss_w_2(ss_i2)))

ss_i2=ss_i2-1
if ss_i2<0 then exit for 


if sss_w_1_1<>sss_w_1_2 and yiyang_com=0 and firstrun=1 then
exit for 
end if

if sss_w_1_1<>sss_w_1_2 and yiyang_com=1 and firstrun=0 then
exit for 
end if

if sss_w_1_1<>sss_w_1_2 and (sss_w_1_1="cn" or sss_w_1_1="com"  or sss_w_1_1="org"  or sss_w_1_1="cc"   or sss_w_1_1="info" or sss_w_1_1="tv") then
yiyang_com=0
end if



if sss_w_1_1=sss_w_1_2 and (sss_w_1_1="cn" or sss_w_1_1="com"  or sss_w_1_1="org"  or sss_w_1_1="cc"   or sss_w_1_1="info"  or sss_w_1_1="tv") then

if firstrun=1 then
firstrun=0
yiyang_com=1
end if

end if



if sss_w_1_1=sss_w_1_2 and yiyang_com=1 and sss_w_1_1<>"cn" and sss_w_1_1<>"com"  and sss_w_1_1<>"org"  and sss_w_1_1<>"cc"   and sss_w_1_1<>"info" and sss_w_1_1<>"tv" then
is_yiyang_root=1
exit for 
end if

next


is_tong_root_www=is_yiyang_root

end Function 

'****************************************8





%>
<%
'is_tong_root_www("http://go.microsoft.com/fwlink/?linkid=8180")
%>
<%
=is_tong_root_www("http://www.aaaa.chinesent.com.cn")
%>